/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ntweets.services;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
import net.oauth.OAuthAccessor;
import net.oauth.OAuthMessage;
import net.oauth.client.OAuthClient;
import net.oauth.client.httpclient4.HttpClient4;
import net.oauth.http.HttpClient;

/**
 *
 * @author olawale
 */
public class ServiceCall {

    private ServiceCall(){
        accessor = InitAccessor.getAccessor();
        http = new HttpClient4();
        client = new OAuthClient(http);

    }

    private OAuthAccessor accessor;
    private HttpClient http;
    private OAuthClient client;

    public OAuthMessage updateStatus(ArrayList<Map.Entry> parameters) throws Exception{
        return client.invoke(accessor, "POST", "http://twitter.com/statuses/update.json", parameters);
    }

}
